package com.zhumei.keyscale.ui;

import me.jingbin.bymvvm.base.*;
import com.zhumei.keyscale.databinding.*;
import kotlin.*;
import org.json.*;
import okhttp3.*;
import kotlin.jvm.internal.*;
import retrofit2.*;
import com.zhumei.keyscale.net.*;
import androidx.databinding.*;
import android.speech.tts.*;
import com.zhumei.keyscale.adapter.*;
import com.blankj.utilcode.util.*;
import android.content.*;
import com.zhumei.keyscale.entity.vo.*;
import com.zhumei.keyscale.entity.*;
import java.util.*;
import me.jingbin.bymvvm.utils.*;
import me.jingbin.bymvvm.livebus.*;
import retrofit2.Callback;

import android.app.*;
import android.text.*;
import android.os.*;

import com.zhumei.keyscale.net.BaseResponse;
import com.zhumei.keyscale.util.*;
import com.uuzuche.lib_zxing.activity.*;
import android.graphics.*;
import android.widget.*;
import android.view.*;
import java.lang.reflect.*;
import androidx.recyclerview.widget.*;
import com.zhumei.keyscale.weight.*;

@Metadata(d1 = { "\u0000p\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0010\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\u0012\u0012\u0006\u0012\u0004\u0018\u00010\u0002\u0012\u0006\u0012\u0004\u0018\u00010\u00030\u0001B\u0005?\u0006\u0002\u0010\u0004J\u0010\u0010;\u001a\u00020<2\u0006\u0010&\u001a\u00020\u0006H\u0002J\u0006\u0010=\u001a\u00020<J$\u0010>\u001a\u00020<2\b\u0010?\u001a\u0004\u0018\u00010\u00062\b\u0010@\u001a\u0004\u0018\u00010\u00062\b\u0010A\u001a\u0004\u0018\u00010\u0006J\b\u0010B\u001a\u00020CH\u0014J\u000e\u0010D\u001a\u00020<2\u0006\u0010&\u001a\u00020\u0006J\b\u0010E\u001a\u00020<H\u0002J\b\u0010F\u001a\u00020<H\u0002J\u0012\u0010G\u001a\u00020<2\b\u0010H\u001a\u0004\u0018\u00010IH\u0014J\b\u0010J\u001a\u00020<H\u0016J\b\u0010K\u001a\u00020<H\u0014J\b\u0010L\u001a\u00020<H\u0014J\u0010\u0010M\u001a\u00020<2\u0006\u0010&\u001a\u00020\u0006H\u0002J\b\u0010N\u001a\u00020<H\u0002J\u0010\u0010O\u001a\u00020<2\u0006\u0010P\u001a\u00020QH\u0016J\u0010\u0010R\u001a\u00020<2\u0006\u0010P\u001a\u00020QH\u0016J\b\u0010S\u001a\u00020<H\u0014J\b\u0010T\u001a\u00020<H\u0002J\b\u0010U\u001a\u00020<H\u0002R\u001a\u0010\u0005\u001a\u00020\u0006X\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b\u0007\u0010\b\"\u0004\b\t\u0010\nR\u000e\u0010\u000b\u001a\u00020\fX\u0082\u000e?\u0006\u0002\n\u0000R\u0010\u0010\r\u001a\u0004\u0018\u00010\u000eX\u0082\u000e?\u0006\u0002\n\u0000R\u001a\u0010\u000f\u001a\u00020\u0010X\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R\u001a\u0010\u0015\u001a\u00020\u0010X\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b\u0016\u0010\u0012\"\u0004\b\u0017\u0010\u0014R\u001c\u0010\u0018\u001a\u0004\u0018\u00010\u0019X\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b\u001a\u0010\u001b\"\u0004\b\u001c\u0010\u001dR\u001c\u0010\u001e\u001a\u0004\u0018\u00010\u001fX\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b \u0010!\"\u0004\b\"\u0010#R\u0010\u0010$\u001a\u0004\u0018\u00010%X\u0082\u000e?\u0006\u0002\n\u0000R\u001a\u0010&\u001a\u00020\u0006X\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b'\u0010\b\"\u0004\b(\u0010\nR\u001a\u0010)\u001a\u00020\fX\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b*\u0010+\"\u0004\b,\u0010-R\u000e\u0010.\u001a\u00020\u0010X\u0082D?\u0006\u0002\n\u0000R\u001a\u0010/\u001a\u000200X\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b1\u00102\"\u0004\b3\u00104R\u001a\u00105\u001a\u00020\fX\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b6\u0010+\"\u0004\b7\u0010-R\u001a\u00108\u001a\u00020\fX\u0086\u000e?\u0006\u000e\n\u0000\u001a\u0004\b9\u0010+\"\u0004\b:\u0010-��\u0006V" }, d2 = { "Lcom/zhumei/keyscale/ui/PayActivity;", "Lme/jingbin/bymvvm/base/BaseActivity;", "Lme/jingbin/bymvvm/base/NoViewModel;", "Lcom/zhumei/keyscale/databinding/ActivityPayBinding;", "()V", "codeUrl", "", "getCodeUrl", "()Ljava/lang/String;", "setCodeUrl", "(Ljava/lang/String;)V", "defaultPos", "", "handler", "Landroid/os/Handler;", "ispay", "", "getIspay", "()Z", "setIspay", "(Z)V", "isqingqiu", "getIsqingqiu", "setIsqingqiu", "mTimer", "Ljava/util/Timer;", "getMTimer", "()Ljava/util/Timer;", "setMTimer", "(Ljava/util/Timer;)V", "mTimerTask", "Ljava/util/TimerTask;", "getMTimerTask", "()Ljava/util/TimerTask;", "setMTimerTask", "(Ljava/util/TimerTask;)V", "mTts", "Landroid/speech/tts/TextToSpeech;", "order_id", "getOrder_id", "setOrder_id", "ordertime", "getOrdertime", "()I", "setOrdertime", "(I)V", "otherFlag", "runnable", "Ljava/lang/Runnable;", "getRunnable", "()Ljava/lang/Runnable;", "setRunnable", "(Ljava/lang/Runnable;)V", "time", "getTime", "setTime", "type", "getType", "setType", "ConfirmPay", "", "Paysuccess", "Showamount", "NetReceipts", "Preferential", "total", "getActivity", "Landroid/app/Activity;", "getPaystatus", "getPaysuccess", "initTTS", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onResume", "onStop", "payOrder", "registerEventBus", "setCacheViewFromContent", "focusView", "Landroid/view/View;", "setmCacheViewFromTab", "showContentView", "timeLoop2", "unregisterEventBus", "app_zhumeiRelease" }, k = 1, mv = { 1, 5, 1 }, xi = 48)
public final class PayActivity extends BaseActivity<NoViewModel, ActivityPayBinding>
{
    private String codeUrl;
    private int defaultPos;
    private Handler handler;
    private boolean ispay;
    private boolean isqingqiu;
    private Timer mTimer;
    private TimerTask mTimerTask;
    private TextToSpeech mTts;
    private String order_id;
    private int ordertime;
    private final boolean otherFlag;
    private Runnable runnable;
    private int time;
    private int type;
    
    public PayActivity() throws JSONException {
        this.type = 1;
        this.codeUrl = "";
        this.order_id = "";
        this.time = 1;
        this.ispay = true;
        this.isqingqiu = true;
        this.handler = new Handler();
        this.runnable = (Runnable)new Thread();
        this.ordertime = 60;
    }
    
    private final void ConfirmPay(final String s) throws JSONException {
        final JSONObject jsonObject = new JSONObject();
        jsonObject.put("id", (Object)s);
        jsonObject.put("isCash", (Object)"1");
        final RequestBody create = RequestBody.create(MediaType.parse("Content-type:application/json;charset=UTF-8"), jsonObject.toString());
        final HttpManager instance = HttpManager.INSTANCE;
        Intrinsics.checkNotNullExpressionValue((Object)create, "requestBody");
        instance.ConfirmCashPay(create, (Callback<BaseResponse<String>>)new PayActivity().ConfirmPay(this)PayActivity$ConfirmPay.PayActivity$ConfirmPay$1(this));
    }
    
    private final void getPaysuccess() {
        this.timeLoop2();
    }
    
    private final void initTTS() {
        if (this.mTts == null) {
            this.mTts = new TextToSpeech((Context)this, (TextToSpeech$OnInitListener)new -$$Lambda$PayActivity$JAG96qh7ksAguhzapNDfb7UmV5g(this));
        }
        final TextToSpeech mTts = this.mTts;
        if (mTts != null) {
            mTts.setPitch(1.0f);
        }
        final TextToSpeech mTts2 = this.mTts;
        if (mTts2 == null) {
            return;
        }
        mTts2.setSpeechRate(1.1f);
    }
    
    private static final void initTTS$lambda-2(final PayActivity payActivity, final int n) {
        Intrinsics.checkNotNullParameter((Object)payActivity, "this$0");
        if (n == 0) {
            final TextToSpeech mTts = payActivity.mTts;
            Object value;
            if (mTts == null) {
                value = null;
            }
            else {
                value = mTts.setLanguage(Locale.CHINA);
            }
            Intrinsics.checkNotNull(value);
            (int)value;
        }
    }
    
    private final void payOrder(final String s) {
        HttpManager.INSTANCE.queryOrderstatus(s, (Callback<BaseResponse<Boolean>>)new PayActivity$payOrder.PayActivity$payOrder$1(this));
    }
    
    private final void registerEventBus() {
        try {
            if (!EventBusUtils.isRegistered((Object)this)) {
                EventBusUtils.register((Object)this);
            }
        }
        catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    private static final void showContentView$lambda-1(final PayActivity payActivity, final Order order, final OrderAdapter orderAdapter, final String s) {
        Intrinsics.checkNotNullParameter((Object)payActivity, "this$0");
        Intrinsics.checkNotNullParameter((Object)order, "$entity");
        Intrinsics.checkNotNullParameter((Object)orderAdapter, "$orderAdapter");
        Intrinsics.checkNotNullParameter((Object)s, "values");
        LogUtils.d(Intrinsics.stringPlus("values==>", (Object)s));
        switch (s.hashCode()) {
            default: {}
            case 1163658: {
                if (!s.equals("\u8fd4\u56de")) {
                    return;
                }
                payActivity.startActivity(new Intent((Context)payActivity, (Class)MainActivity.class));
                payActivity.finish();
            }
            case 1049928: {
                if (!s.equals("\u7f6e\u96f6")) {
                    return;
                }
                final List<GoodsDetailVo> goodsDetailVoList = order.getGoodsDetailVoList();
                Intrinsics.checkNotNullExpressionValue((Object)goodsDetailVoList, "entity.goodsDetailVoList");
                if (!(goodsDetailVoList.isEmpty() ^ true)) {
                    break;
                }
                ++payActivity.defaultPos;
                final List<GoodsDetailVo> data = orderAdapter.getData();
                if (data == null) {
                    return;
                }
                if (payActivity.defaultPos >= data.size()) {
                    payActivity.defaultPos = data.size() - 1;
                }
                if (payActivity.defaultPos % 4 == 0) {
                    final ActivityPayBinding activityPayBinding = (ActivityPayBinding)payActivity.bindingView;
                    if (activityPayBinding != null) {
                        final RecyclerView rvGoods = activityPayBinding.rvGoods;
                        if (rvGoods != null) {
                            rvGoods.smoothScrollBy(0, 200);
                        }
                    }
                }
                orderAdapter.setSelPos(payActivity.defaultPos);
                EventBusUtils.post((Object)new EventBean(64, (Object)payActivity.defaultPos));
            }
            case 991478: {
                if (!s.equals("\u786e\u8ba4")) {
                    return;
                }
                if (payActivity.getType() == 2 || payActivity.getType() == 3) {
                    payActivity.ConfirmPay(payActivity.getOrder_id());
                    return;
                }
                break;
            }
            case 694867: {
                if (!s.equals("\u53bb\u76ae")) {
                    return;
                }
                final List<GoodsDetailVo> goodsDetailVoList2 = order.getGoodsDetailVoList();
                Intrinsics.checkNotNullExpressionValue((Object)goodsDetailVoList2, "entity.goodsDetailVoList");
                if (goodsDetailVoList2.isEmpty() ^ true) {
                    if (--payActivity.defaultPos <= 0) {
                        payActivity.defaultPos = 0;
                    }
                    if (payActivity.defaultPos % 4 == 0) {
                        final ActivityPayBinding activityPayBinding2 = (ActivityPayBinding)payActivity.bindingView;
                        if (activityPayBinding2 != null) {
                            final RecyclerView rvGoods2 = activityPayBinding2.rvGoods;
                            if (rvGoods2 != null) {
                                rvGoods2.smoothScrollBy(0, -200);
                            }
                        }
                    }
                    orderAdapter.setSelPos(payActivity.defaultPos);
                    EventBusUtils.post((Object)new EventBean(57, (Object)payActivity.defaultPos));
                    break;
                }
                break;
            }
        }
    }
    
    private final void timeLoop2() {
        this.mTimer = new Timer();
        this.mTimerTask = (TimerTask)new PayActivity$timeLoop2.PayActivity$timeLoop2$1(this);
        final Timer mTimer = this.mTimer;
        Intrinsics.checkNotNull((Object)mTimer);
        mTimer.schedule(this.mTimerTask, 0L, 3000L);
    }
    
    private final void unregisterEventBus() {
        try {
            if (EventBusUtils.isRegistered((Object)this)) {
                EventBusUtils.unRegister((Object)this);
            }
        }
        catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    public final void Paysuccess() {
        final ViewDataBinding bindingView = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView);
        ((ActivityPayBinding)bindingView).rlPaySuccess.setVisibility(0);
        final ViewDataBinding bindingView2 = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView2);
        ((ActivityPayBinding)bindingView2).llTitle.setVisibility(8);
        final ViewDataBinding bindingView3 = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView3);
        ((ActivityPayBinding)bindingView3).rvGoods.setVisibility(8);
        EventBusUtils.post((Object)new EventBean(55, (Object)true));
        final Timer mTimer = this.mTimer;
        if (mTimer != null) {
            mTimer.cancel();
        }
        final Handler handler = this.handler;
        Intrinsics.checkNotNull((Object)handler);
        handler.postDelayed(this.runnable, 1000L);
        final Order order = new Order();
        order.setGoodsDetailVoList(new ArrayList<GoodsDetailVo>());
        order.setTotalAmount(0.0);
        order.setNotzero(0.0);
        order.setDiscount(100);
        order.setTotaldiscount(0.0);
        MmkvUtils.getInstance().putEntity("order", (Object)order);
        LiveDataBus.getInstance().with("A").postStickyData((Object)1);
    }
    
    public final void Showamount(final String s, final String s2, final String s3) {
        final ViewDataBinding bindingView = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView);
        ((ActivityPayBinding)bindingView).tvNetReceiptsTotal.setText((CharSequence)s);
        final ViewDataBinding bindingView2 = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView2);
        ((ActivityPayBinding)bindingView2).tvPreferentialAmount.setText((CharSequence)s2);
        final ViewDataBinding bindingView3 = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView3);
        ((ActivityPayBinding)bindingView3).tvTotal.setText((CharSequence)s3);
    }
    
    protected Activity getActivity() {
        return (Activity)this;
    }
    
    public final String getCodeUrl() {
        return this.codeUrl;
    }
    
    public final boolean getIspay() {
        return this.ispay;
    }
    
    public final boolean getIsqingqiu() {
        return this.isqingqiu;
    }
    
    public final Timer getMTimer() {
        return this.mTimer;
    }
    
    public final TimerTask getMTimerTask() {
        return this.mTimerTask;
    }
    
    public final String getOrder_id() {
        return this.order_id;
    }
    
    public final int getOrdertime() {
        return this.ordertime;
    }
    
    public final void getPaystatus(final String s) {
        Intrinsics.checkNotNullParameter((Object)s, "order_id");
        if (TextUtils.isEmpty((CharSequence)s)) {
            MyToast.showShort("\u8ba2\u5355\u53f7\u4e0d\u80fd\u4e3a\u7a7a\uff01");
            return;
        }
        this.payOrder(s);
    }
    
    public final Runnable getRunnable() {
        return this.runnable;
    }
    
    public final int getTime() {
        return this.time;
    }
    
    public final int getType() {
        return this.type;
    }
    
    protected void onCreate(final Bundle bundle) {
        super.onCreate(bundle);
        this.setContentView(2131427360);
        this.showContentView();
        final String stringExtra = this.getIntent().getStringExtra("order_id");
        Intrinsics.checkNotNullExpressionValue((Object)stringExtra, "intent.getStringExtra(\"order_id\")");
        this.order_id = stringExtra;
        if (this.getIntent().getIntExtra("type", 0) == 0) {
            this.type = 2;
        }
        else if (this.getIntent().getIntExtra("type", 0) == 3) {
            this.type = 3;
        }
        else if (this.getIntent().getIntExtra("type", 0) == 1) {
            final String stringExtra2 = this.getIntent().getStringExtra("url");
            Intrinsics.checkNotNullExpressionValue((Object)stringExtra2, "intent.getStringExtra(\"url\")");
            this.codeUrl = stringExtra2;
            this.type = 4;
        }
        else if (this.getIntent().getIntExtra("type", 0) == 2) {
            final String stringExtra3 = this.getIntent().getStringExtra("url");
            Intrinsics.checkNotNullExpressionValue((Object)stringExtra3, "intent.getStringExtra(\"url\")");
            this.codeUrl = stringExtra3;
            this.type = 5;
        }
        final ActivityPayBinding activityPayBinding = (ActivityPayBinding)this.bindingView;
        TextView tvTotal;
        if (activityPayBinding == null) {
            tvTotal = null;
        }
        else {
            tvTotal = activityPayBinding.tvTotal;
        }
        if (tvTotal != null) {
            final String stringExtra4 = this.getIntent().getStringExtra("totalMoney");
            Intrinsics.checkNotNullExpressionValue((Object)stringExtra4, "intent.getStringExtra(\"totalMoney\")");
            tvTotal.setText((CharSequence)MathUtils.keepTwoDecimalDigits(Double.parseDouble(stringExtra4)));
        }
        final ActivityPayBinding activityPayBinding2 = (ActivityPayBinding)this.bindingView;
        TextView tvPreferentialAmount;
        if (activityPayBinding2 == null) {
            tvPreferentialAmount = null;
        }
        else {
            tvPreferentialAmount = activityPayBinding2.tvPreferentialAmount;
        }
        if (tvPreferentialAmount != null) {
            final String stringExtra5 = this.getIntent().getStringExtra("discountAmount");
            Intrinsics.checkNotNullExpressionValue((Object)stringExtra5, "intent.getStringExtra(\"discountAmount\")");
            tvPreferentialAmount.setText((CharSequence)MathUtils.keepTwoDecimalDigits(Double.parseDouble(stringExtra5)));
        }
        final ActivityPayBinding activityPayBinding3 = (ActivityPayBinding)this.bindingView;
        TextView tvNetReceiptsTotal;
        if (activityPayBinding3 == null) {
            tvNetReceiptsTotal = null;
        }
        else {
            tvNetReceiptsTotal = activityPayBinding3.tvNetReceiptsTotal;
        }
        if (tvNetReceiptsTotal != null) {
            final String stringExtra6 = this.getIntent().getStringExtra("realMoney");
            Intrinsics.checkNotNullExpressionValue((Object)stringExtra6, "intent.getStringExtra(\"realMoney\")");
            tvNetReceiptsTotal.setText((CharSequence)MathUtils.keepTwoDecimalDigits(Double.parseDouble(stringExtra6)));
        }
        final int type = this.type;
        if (type == 2) {
            final ViewDataBinding bindingView = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView);
            ((ActivityPayBinding)bindingView).tvPayType.setText((CharSequence)"\u73b0\u91d1\u6536\u6b3e");
            final ViewDataBinding bindingView2 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView2);
            ((ActivityPayBinding)bindingView2).imagePayQrcode.setVisibility(8);
            final ViewDataBinding bindingView3 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView3);
            ((ActivityPayBinding)bindingView3).llPayType.setVisibility(8);
            final ViewDataBinding bindingView4 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView4);
            ((ActivityPayBinding)bindingView4).imagePay.setVisibility(0);
            final ViewDataBinding bindingView5 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView5);
            ((ActivityPayBinding)bindingView5).imagePay.setImageResource(2131492870);
        }
        else if (type == 3) {
            final ViewDataBinding bindingView6 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView6);
            ((ActivityPayBinding)bindingView6).tvPayType.setText((CharSequence)"\u4f1a\u5458\u5361\u6536\u6b3e");
            final ViewDataBinding bindingView7 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView7);
            ((ActivityPayBinding)bindingView7).imagePayQrcode.setVisibility(8);
            final ViewDataBinding bindingView8 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView8);
            ((ActivityPayBinding)bindingView8).llPayType.setVisibility(8);
            final ViewDataBinding bindingView9 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView9);
            ((ActivityPayBinding)bindingView9).imagePay.setVisibility(0);
            final ViewDataBinding bindingView10 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView10);
            ((ActivityPayBinding)bindingView10).imagePay.setImageResource(2131492897);
        }
        else if (type == 4 || type == 5) {
            final ViewDataBinding bindingView11 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView11);
            ((ActivityPayBinding)bindingView11).tvPayType.setText((CharSequence)"\u805a\u5408\u6536\u6b3e\u7801");
            final ViewDataBinding bindingView12 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView12);
            ((ActivityPayBinding)bindingView12).imagePayQrcode.setVisibility(0);
            final ViewDataBinding bindingView13 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView13);
            ((ActivityPayBinding)bindingView13).llPayType.setVisibility(0);
            final ViewDataBinding bindingView14 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView14);
            ((ActivityPayBinding)bindingView14).imagePay.setVisibility(8);
            final ViewDataBinding bindingView15 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView15);
            ((ActivityPayBinding)bindingView15).imagePayQrcode.setImageBitmap(CodeUtils.createImage(this.codeUrl, 300, 300, null));
        }
        final int type2 = this.type;
        if (type2 == 4 || type2 == 5) {
            this.getPaysuccess();
        }
        final String stringExtra7 = this.getIntent().getStringExtra("totalMoney");
        Intrinsics.checkNotNullExpressionValue((Object)stringExtra7, "intent.getStringExtra(\"totalMoney\")");
        EventBusUtils.post((Object)new EventBean(51, MathUtils.keepTwoDecimalDigits(Double.parseDouble(stringExtra7))));
        final String stringExtra8 = this.getIntent().getStringExtra("discountAmount");
        Intrinsics.checkNotNullExpressionValue((Object)stringExtra8, "intent.getStringExtra(\"discountAmount\")");
        EventBusUtils.post((Object)new EventBean(52, MathUtils.keepTwoDecimalDigits(Double.parseDouble(stringExtra8))));
        final String stringExtra9 = this.getIntent().getStringExtra("realMoney");
        Intrinsics.checkNotNullExpressionValue((Object)stringExtra9, "intent.getStringExtra(\"realMoney\")");
        EventBusUtils.post((Object)new EventBean(53, MathUtils.keepTwoDecimalDigits(Double.parseDouble(stringExtra9))));
        EventBusUtils.post((Object)new EventBean(49, (Object)true));
        EventBusUtils.post((Object)new EventBean(50, (Object)this.type));
        EventBusUtils.post((Object)new EventBean(56, this.codeUrl));
    }
    
    public void onDestroy() {
        super.onDestroy();
        final Handler handler = this.handler;
        if (handler != null) {
            Intrinsics.checkNotNull((Object)handler);
            handler.removeCallbacks(this.runnable);
            this.handler = null;
        }
        final Timer mTimer = this.mTimer;
        if (mTimer == null) {
            return;
        }
        mTimer.cancel();
    }
    
    protected void onResume() {
        super.onResume();
        this.registerEventBus();
        this.initTTS();
    }
    
    protected void onStop() {
        super.onStop();
        EventBusUtils.post((Object)new EventBean(49, (Object)false));
        this.unregisterEventBus();
        final TextToSpeech mTts = this.mTts;
        if (mTts != null) {
            Intrinsics.checkNotNull((Object)mTts);
            mTts.stop();
            this.mTts = null;
        }
        final Timer mTimer = this.mTimer;
        if (mTimer == null) {
            return;
        }
        mTimer.cancel();
    }
    
    public void setCacheViewFromContent(final View view) {
        Intrinsics.checkNotNullParameter((Object)view, "focusView");
    }
    
    public final void setCodeUrl(final String codeUrl) {
        Intrinsics.checkNotNullParameter((Object)codeUrl, "<set-?>");
        this.codeUrl = codeUrl;
    }
    
    public final void setIspay(final boolean ispay) {
        this.ispay = ispay;
    }
    
    public final void setIsqingqiu(final boolean isqingqiu) {
        this.isqingqiu = isqingqiu;
    }
    
    public final void setMTimer(final Timer mTimer) {
        this.mTimer = mTimer;
    }
    
    public final void setMTimerTask(final TimerTask mTimerTask) {
        this.mTimerTask = mTimerTask;
    }
    
    public final void setOrder_id(final String order_id) {
        Intrinsics.checkNotNullParameter((Object)order_id, "<set-?>");
        this.order_id = order_id;
    }
    
    public final void setOrdertime(final int ordertime) {
        this.ordertime = ordertime;
    }
    
    public final void setRunnable(final Runnable runnable) {
        Intrinsics.checkNotNullParameter((Object)runnable, "<set-?>");
        this.runnable = runnable;
    }
    
    public final void setTime(final int time) {
        this.time = time;
    }
    
    public final void setType(final int type) {
        this.type = type;
    }
    
    public void setmCacheViewFromTab(final View view) {
        Intrinsics.checkNotNullParameter((Object)view, "focusView");
    }
    
    protected void showContentView() {
        final ViewDataBinding bindingView = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView);
        if (((ActivityPayBinding)bindingView).getRoot().getVisibility() != 0) {
            final ViewDataBinding bindingView2 = this.bindingView;
            Intrinsics.checkNotNull((Object)bindingView2);
            ((ActivityPayBinding)bindingView2).getRoot().setVisibility(0);
        }
        final Object entity = MmkvUtils.getInstance().getEntity("order", (Type)Order.class);
        Intrinsics.checkNotNullExpressionValue(entity, "getInstance().getEntity(\u2026ORDER, Order::class.java)");
        final Order order = (Order)entity;
        final LinearLayoutManager linearLayoutManager = new LinearLayoutManager((Context)this);
        final ViewDataBinding bindingView3 = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView3);
        ((ActivityPayBinding)bindingView3).rvGoods.setLayoutManager((RecyclerView.LayoutManager)linearLayoutManager);
        final OrderAdapter orderAdapter = new OrderAdapter(order.getGoodsDetailVoList());
        final ViewDataBinding bindingView4 = this.bindingView;
        Intrinsics.checkNotNull((Object)bindingView4);
        ((ActivityPayBinding)bindingView4).rvGoods.setAdapter((RecyclerView.Adapter)orderAdapter);
        EventBusUtils.post((Object)new EventBean(54, order.getGoodsDetailVoList()));
        SerialPortUtil.getSerialPortUtil().setKeyboardsInterface((SerialPortUtil.KeyboardsInterface)new -$$Lambda$PayActivity$9-RdvTyVS9miNEFe7-XrjCHTtmw(this, order, orderAdapter));
    }
}
